package com.sugar.subscribe.course.module.business.controller.app.order.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

import static com.sugar.subscribe.course.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;

@Schema(description = "APP - 订单 Response VO")
@Data
public class AppUserOrderPageRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1775")
    private Long id;

    @Schema(description = "教练ID", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long coachId;

    @Schema(description = "订单编号", requiredMode = Schema.RequiredMode.REQUIRED)
    private String orderNo;

    @Schema(description = "上课日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonSerialize(using = LocalDateSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalDateDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
    private LocalDate attendClassDate;

    @Schema(description = "上课地点名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    private String venueName;

    @Schema(description = "服务一级分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    private String servicePName;

    @Schema(description = "服务二级分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    private String serviceName;

    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @JsonSerialize(using = LocalTimeSerializer.class) // 序列化（响应）
    @JsonDeserialize(using = LocalTimeDeserializer.class) // 反序列化（请求）
    @JsonFormat(pattern = "HH:mm")
    private LocalTime startTime;

    @Schema(description = "教学人数（字典：business_coach_service_people_count）", requiredMode = Schema.RequiredMode.REQUIRED, example = "19")
    private String peopleCount;

    @Schema(description = "教学时间（字典：business_coach_service_time）", requiredMode = Schema.RequiredMode.REQUIRED)
    private String serviceTime;

    @Schema(description = "是否修改过上课时间：[0否；1是]", requiredMode = Schema.RequiredMode.REQUIRED)
    private Boolean updatedAttendClassDate;

    @Schema(description = "支付状态（0待支付；1已支付）", example = "1")
    private Boolean paymentStatus;

    @Schema(description = "订单状态（0待接单；1已取消；2待上课；3待确认；4已完成）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer status;
}
